package com.abe.mvpcore.use;

import com.abe.mvpcore.BasePresenter;
import com.abe.mvpcore.OnResultListener;

public class ExPresenter extends BasePresenter<ExContract.ExView, ExModel> implements ExContract.ExPresenter {

    @Override
    public void reqEx() {
        getModel().reqEx(new OnResultListener<Boolean>() {
            @Override
            public void onStart() {

            }

            @Override
            public void onEnd() {
                ExPresenter.this.onEnd(ExPresenter.class.getSimpleName());
            }

            @Override
            public void onSuccess(Boolean data) {
                if (ExPresenter.this.onSuccess(data)) {
                    getView().onReqEx(data);
                }
            }

            @Override
            public void onFailure(String message) {
                ExPresenter.this.onFailure(ExPresenter.class.getSimpleName());
            }
        });
    }
}
